#ifndef __THROW_ON_HPP__
#define __THROW_ON_HPP__

#include <string>
#include <sstream>
#include <stdexcept>

template <typename E = std::runtime_error>
class throw_on {
	public:
		throw_on (bool condition, const std::string& message = "") {
			if (condition) {
				throw E(message);
			}	
		}
};

#endif /* __THROW_ON_HPP__ */

